package free_practice.work;

/**
 * @author fangzhiyi
 * @version 1.0
 * @date 2025/3/22 13:56
 * @description 学生类
 * 自己定义类,最少两个,功能方法最少7个
 */
public class Student {
    //属性
    private int id;
    private String name;
    private String sex;
    private int age;
    private double score;
    private String posts;

    public Student() {
    }

    public Student(int id, String name, String sex, int age, double score, String posts) {
        this.id = id;
        this.name = name;
        this.sex = sex;
        this.age = age;
        this.score = score;
        this.posts = posts;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public double getScore() {
        return score;
    }

    public void setScore(double score) {
        this.score = score;
    }

    public String getPosts() {
        return posts;
    }

    public void setPosts(String posts) {
        this.posts = posts;
    }

    @Override
    public String toString() {
        return "Student{" +
                "学号：" + id +
                ", 姓名：'" + name + '\'' +
                ", 性别：'" + sex + '\'' +
                ", 年龄：" + age +
                ", 成绩：" + score +
                ", 官职'" + posts + '\'' +
                '}';
    }
}
